import Taro from '@tarojs/taro'

import {baseUrl} from '../constants/url'

export const loginaction = (user_name,password) => {
  const result = Taro.request({
    url:baseUrl+'api/session/login',
    method:'POST',
    data:{
      user_name,
      password
    }
  })
  return result
}

export const registeraction = (user_name,password,nickname,user_email) => {
  const result = Taro.request({
    url:baseUrl+'api/session/register',
    method:'POST',
    data:{
      user_name,
      password,
      nickname,
      user_email
    }
  })
  return result
}
